home *** CD-ROM | disk | FTP | other *** search
/ Aminet 7 / Aminet 7 - August 1995.iso / Aminet / misc / math / gpamiga_1_38_3.lha / elisp / pari.elc < prev    next >
Encoding:
Text File  |  1993-12-09  |  16.2 KB  |  309 lines

  1.  
  2. (provide (quote gp))
  3.  
  4. (defconst gp-chap3 "pari:doc/usersch3.tex" "\
  5. The TeX source for chapter 3 of the PARI-GP manual")
  6.  
  7. (defconst gp-file-name "pari:bin/gp.68881" "\
  8. The file name of the gp executable file")
  9.  
  10. (defconst gp-man-dvi "pari:doc/users.dvi" "\
  11. dvi version of the manual")
  12.  
  13. (defconst gp-menu "pari:elisp/pari.menu" "\
  14. menu file")
  15.  
  16. (defconst gp-dvi-preview "xdvi -s 3" "\
  17. dvi previewer (and options)")
  18.  
  19. (defvar gp-stack-size "1000000" "\
  20. Default stack size: passed to the progam gp.")
  21.  
  22. (defvar gp-buffer-size "30000" "\
  23. Default buffer size: passed to the progam gp.")
  24.  
  25. (defvar gp-prime-limit "500000" "\
  26. Default prime limit: passed to the progam gp.")
  27.  
  28. (defvar gp-prompt-for-args nil "\
  29. A non-nil value makes M-x gp act like C-u M-x gp, 
  30.    ie prompt for the command line arguments.")
  31.  
  32. (setq gp-temp-file (make-temp-name "t:gp_"))
  33.  
  34. (defvar gp-prompt-pattern "---- (type return to continue) ----\\|\\?[
  35.      ]*" "Regexp used to match gp prompts.
  36.    can be set with gp-set-prompt (bound to M-\\ p)")
  37.  
  38. (defconst gp-c-array (make-vector 509 0) "\
  39. obarray used fo completing gp command names")
  40.  
  41. (defvar gp-map (make-sparse-keymap) "\
  42. Local keymap used in buffer *PARI*.")
  43.  
  44. (define-key gp-map "
  45. " (quote gp-send-input))
  46.  
  47. (define-key gp-map "" (quote gp-copy-input))
  48.  
  49. (define-key gp-map "‰" (quote gp-complete))
  50.  
  51. (define-key gp-map "Üp" (quote gp-set-prompt))
  52.  
  53. (define-key gp-map "Üt" (quote gp-meta-t))
  54.  
  55. (define-key gp-map "Üd" (quote gp-meta-d))
  56.  
  57. (define-key gp-map "Ür" (quote gp-meta-r))
  58.  
  59. (define-key gp-map "Üw" (quote gp-meta-w))
  60.  
  61. (define-key gp-map "Üv" (quote gp-meta-v))
  62.  
  63. (define-key gp-map "Üx" (quote gp-meta-x))
  64.  
  65. (define-key gp-map "Üs" (quote gp-meta-s))
  66.  
  67. (define-key gp-map "Üa" (quote gp-meta-a))
  68.  
  69. (define-key gp-map "Üb" (quote gp-meta-b))
  70.  
  71. (define-key gp-map "Üm" (quote gp-meta-m))
  72.  
  73. (define-key gp-map "Ük" (quote gp-meta-k))
  74.  
  75. (define-key gp-map "Üq" (quote gp-meta-q))
  76.  
  77. (define-key gp-map "¿" (quote gp-get-man-entry))
  78.  
  79. (define-key gp-map "Üc" (quote gp-menu))
  80.  
  81. (define-key gp-map "Ü\\" (quote gp-break-long-line))
  82.  
  83. (define-key gp-map "" (quote gp-interrupt))
  84.  
  85. (defvar gp-process nil "\
  86. ")
  87.  
  88. (defvar gp-man-process nil "\
  89. ")
  90.  
  91. (defun gp (flag) "\
  92.  
  93.    Open a buffer and a window for the execution of gp.
  94.  
  95.    The following bindings are available:
  96.    \\{gp-map}
  97.  
  98.   The variables
  99.   gp-file-name gp-stack-size gp-buffer-size gp-prime-limit
  100.   determine the command line that starts gp.
  101.   To override the default settings, give gp a prefix argument.
  102.   C-u M-x gp ." (interactive "P") (byte-code "ÁˆÑÒ!ˆdbˆÓ!…ÔÕ!Ö!=ƒÁ‚š× ˆØ‰ˆÙ‰ˆÚÛ!ˆÜ !ˆÝ‰ˆÞ!ˆ†@ßà
  103. á$ßâ ã$ßä å$ßæ
  104. ç$R    è    èQcˆ`éêÒëì    P%‰ˆí ˆŠîï\"ˆðñò!óò!\"‰))*ˆôõ\"‡" [gp-process nil major-mode mode-name gp-map mode-line-process gp-menu flag gp-prompt-for-args gp-command gp-file-name gp-stack-size gp-buffer-size gp-prime-limit gp-begin shell-file-name gp-version switch-to-buffer "*PARI*" processp intern "run" process-status kill-all-local-variables gp "GP" run-hooks gp-mode-hook use-local-map (": %s") gp-completion-file gp-read-input "Gp executable ?" "" "Stack size ?" " -s " "Buffer size ?" " -b " "Prime limit ?" " -p " "
  105. " start-process "pari" "-c" "stty nl; exec " gp-wait-for-output re-search-backward "Version  *\\([.0-9]*\\)" buffer-substring match-beginning 1 match-end set-process-sentinel gp-sentinel] 21))
  106.  
  107. (defun gp-read-input (prompt default sep flag) "\
  108.  If flag is non-nil, reads string then if string is \"\" uses default.
  109.   If flag is nil then string is the default.
  110.   If resulting string is not \"\" prepends sep.
  111.   As a special case, if string is a space, return \"\"." (byte-code "    ƒÅ
  112. Æ ÇR!‚ ÈÉ\"ƒ(È É\"ƒ\"ɂ% P‚6ÈÊ\"ƒ3ɂ6 P)‡" [string flag prompt default sep read-input " (Default " ") " equal "" " "] 6))
  113.  
  114. (defun gp-sentinel (proc msg) "\
  115. Sentinel for the gp-process in buffer *PARI*." (byte-code "ÇÈ!…    ÉÈ!ˆÊ    !…É!)ˆÊ
  116. !…\"É!)ˆÇË!…6Ëqˆdbˆ cˆÌË!ˆÍ !…EÎ !ˆÏÐ \"ˆÆ‰‡" [b gp-chap3 gp-menu msg gp-temp-file gp-process nil get-buffer "*gp-help*" kill-buffer get-file-buffer "*PARI*" delete-windows-on file-exists-p delete-file message "Removing %s"] 13))
  117.  
  118. (defun gpman nil "\
  119. Start up xdvi with the gp manual." (interactive) (byte-code "ÁˆÅÆ!ˆÇÈ!qˆƒÁ‚-ÉÊ
  120. Ë R!ˆÌÍÈ ÎÏ
  121. Ë R%‰ˆÐÑ\"‡" [gp-man-process nil gp-dvi-preview gp-man-dvi shell-file-name run-hooks gp-mode-hook get-buffer-create "*GP-MAN*" message "Starting " " " start-process "gp-man" "-c" "exec " set-process-sentinel gp-man-sentinel] 12))
  122.  
  123. (defun gp-man-sentinel (proc msg) "\
  124. Sentinel for the gp-man-process in buffer *GP-MAN*." (byte-code "Å    !… Æ!)ˆÇÈ
  125. P!ˆÄ‰‡" [buf proc msg gp-man-process nil process-buffer kill-buffer message "gpman: "] 5))
  126.  
  127. (defun gp-copy-input nil "\
  128. Copy expression around point to the end of the buffer.
  129.    (Unless this is already the last expression.)" (interactive) (byte-code "ɈÊ!ˆËÌ!Í ˆÎ!ˆ`‰ˆ    b)ˆÎÏÐQdÄ# ƒ,ÑÌ!‚-d
  130. bˆÒÓ!ƒ;Ԃ<ÕÎ
  131. Ö#‰ˆ`‰ˆ …jdbˆ×
  132. \"cˆƒdɂjØ ˆÙÚ!)))‡" [gp-prompt-pattern p gp-input-start nlast t limit end-expression gp-complete-expression gp-input-end nil re-search-backward match-end 0 beginning-of-line re-search-forward "[
  133.  ]*\\(" "\\|^%[0-9]+ = \\|^ *\\*\\*\\*\\|^ *unused characters\\|^ *time[ r]\\)" match-beginning looking-at " *{" "}$" "[^\\]$" 1 buffer-substring ding message "Incomplete expression."] 12))
  134.  
  135. (defun gp-send-input nil "\
  136. Send input to gp. Does not send incomplete expressions
  137.    ie those starting with {, without a matching }, or those
  138.    ending with \\ .
  139.    Use a temporary file (and \\r ) for large expressions" (interactive) (byte-code "ňƠˆÇcˆƒ8    
  140. ZÈVƒ$É
  141.      #ˆÊ Ë ÇQ\"‚.Ì
  142.     #ˆÊ Ç\"ˆÍÎ !`\"‚;ÏÐ!‡" [gp-complete-expression gp-input-end gp-input-start gp-temp-file gp-process nil gp-copy-input "
  143. " 255 write-region process-send-string "\\r " process-send-region set-marker process-mark message "Incomplete expression: Not sent to gp."] 9))
  144.  
  145. (defun gp-interrupt nil "\
  146. Interrupt gp.
  147.    This is identical to interrupt-shell-subjob in shell-mode." (interactive) (byte-code "ÀˆÂÀÁ\"‡" [nil t interrupt-process] 3))
  148.  
  149. (defun gp-set-prompt (p) "\
  150. Set new gp prompt (and tell emacs that you have done so).
  151.    Do not put spaces in the argument, or emacs and gp will
  152.    have a different idea about what the prompt is." (interactive "sNew prompt: ") (byte-code "ˆà   !ÄQ‰ˆÅqˆdbˆÆ    PcˆÇ ‡" [gp-prompt-pattern p nil regexp-quote "[
  153.      ]*\\|" "*PARI*" "\\prompt=" gp-send-input] 4))
  154.  
  155. (defun gp-replace (a b) "\
  156. Replace the regexp a by the string b everywhere in the current buffer" (byte-code "ebˆÃdÁ#…Ä
  157. ÁÁ#ˆ‚‡" [a t b re-search-forward replace-match] 6))
  158.  
  159. (defun gp-get-man-entry (fn) "\
  160. Obtains the description of fn from chapter 3 of the manual.
  161.   Strips off some (not all) of the TeX syntax, and displays the result
  162.   in a new window.
  163.   If there is no entry for fn in the manual, sends ?fn to gp.
  164.   If a definition for fn is found, adds fn to the array of possible
  165.   completions" (interactive (byte-code "ŠÃÄ!ˆÅÆ`ÃÇ!ˆ`\"!)ÈÉÊ
  166. \"…ËÌQÍQ
  167. \"Π   Ï\"ƒ9Ê
  168. \"ƒ5‚6Ђ:    *C‡" [word arg gp-c-array forward-word -1 downcase buffer-substring 1 completing-read "Function" intern-soft " (Default " ")" ": " equal "" " "] 10)) (byte-code "ĈÄÌ
  169. !q)ˆÍÎ\"ƒςÊÍÐ\"ƒ\"тÊÍÒ\"ƒ.ӂÊÍÔ\"ƒ:ՂÊÍÖ\"ƒFׂÊÍØ\"ƒRقÊÍÚ\"ƒ^ۂÊÍÜ\"ƒj݂ÊÍÞ\"ƒv߂ÊÍà\"ƒ‚á‚ÊÍâ\"†¿Íã\"†¿Íä\"†¿Íå\"†¿Íæ\"†¿Íç\"†¿Íè\"†¿Íé\"ƒÆê‚Êë!ebˆìíîQdÈ#ƒ/ïð!bˆñ`ìòdÈ#ˆóô!\"õ 
  170.     ö÷ø!!ˆù ˆ    cˆúûØ\"ˆúüý\"ˆúÏÎ\"ˆúþÐ\"ˆúÿ \"ˆú@A\"ˆebˆB
  171. !*‚BCqˆDEF!P!)ˆøqˆGH!ƒmIJø!!ˆKø!ˆLM\"‚sN!‡" [word arg gp-c-array auto-mode-alist nil gp-chap3 qfn fn t copy wind gp-version find-file-noselect equal "\\" "\\\\backslash" "^" "\\\\hat{}" "!" "fact" "~" "trans" "_" "conj" "-" "\\+" "%" "\\\\%" "min" "max" "log" "ln" "det2" "det" "<=" "<" ">=" ">" "==" "!=" "||" "&&" "comparison and \\\\ref{boolean operators}" regexp-quote re-search-forward "\\(subsec[\\\\{ref]*[\\${]\\)" "[}\\$]" match-end 1 buffer-substring "[tT]he library\\|\\\\[sub]*sec" match-beginning 0 selected-window switch-to-buffer-other-window get-buffer-create "*gp-help*" erase-buffer gp-replace "\\$-" "\\$" " " "\\\\hat" "\\\\vers" "\\\\smallskip\\|\\\\sref{[ a-z]*}\\|\\\\bf\\|\\\\ref\\|\\\\Bbb\\|\\\\text\\|\\\\tt\\|{\\|}" "" select-window "*PARI*" gp-meta-command "?" downcase looking-at "Unknown function" bury-buffer get-buffer delete-windows-on message "Unknown function: %s" gp-add-symbol] 46))
  172.  
  173. (defun gp-meta-command (command) "\
  174. Send command to gp, and display output in help buffer" (byte-code "ŠdbˆÅÆ!`\"ˆ`Ç È ÉP\"ˆÊ ˆË    d\"Ì    d\"ˆÍÎÏ!!ˆÐ ˆ cˆÑ ˆÌ`d\"ˆebˆÒ
  175. !)*)‡" [gp-process temp wind command copy set-marker process-mark selected-window process-send-string "
  176. " gp-wait-for-output buffer-substring delete-region switch-to-buffer-other-window get-buffer-create "*gp-help*" erase-buffer beginning-of-line select-window] 14))
  177.  
  178. (defun gp-wait-for-output nil "\
  179. Hang around until the prompt appears." (byte-code "Á…9Æ
  180. !ˆ`Ç ˆÈ
  181. !…ÉÊ
  182. !=?†!Ë !ƒ.ÌÍ!ˆÅ‰‚1ÌÎ!ˆ b)ˆ‚)‡" [ndone t gp-process p gp-prompt-pattern nil accept-process-output beginning-of-line processp run process-status looking-at message "done" "Waiting for gp output ..."] 9))
  183.  
  184. (defun gp-meta-d nil "\
  185. Sends \\d to gp, then displays output in the help buffer.
  186.   Prints the gp defaults." (interactive) (byte-code "ÀˆÁÂ!‡" [nil gp-meta-command "\\d"] 2))
  187.  
  188. (defun gp-meta-t nil "\
  189. Sends \\t to gp, then displays output in the help buffer.
  190.   Prints the longword format of PARI types." (interactive) (byte-code "ÀˆÁÂ!‡" [nil gp-meta-command "\\t"] 2))
  191.  
  192. (defun gp-meta-r (file) "\
  193. Sends a \\r <file name> comand to gp.
  194.    Reads in gp commands from a file." (interactive "fRead from file: ") (byte-code "ÁˆdbˆÂÃ!PcˆÄ ‡" [file nil "\\r " expand-file-name gp-send-input] 3))
  195.  
  196. (defun gp-meta-w (file num) "\
  197. Sends a \\w<num> <file name> comand to gp.
  198.   Writes gp object %<num> to <file name>." (interactive "FWrite to file: 
  199. sObject number %%") (byte-code "ˆdbˆÃÄÅ    !RcˆÆ ‡" [num file nil "\\w" " " expand-file-name gp-send-input] 5))
  200.  
  201. (defun gp-meta-x nil "\
  202. Sends \\x to gp, then displays output in the help buffer.
  203.   Prints tree of addresses and contents of last object." (interactive) (byte-code "ÀˆÁÂ!‡" [nil gp-meta-command "\\x"] 2))
  204.  
  205. (defun gp-meta-v nil "\
  206. Sends \\v to gp, then displays output in the help buffer.
  207.   Prints the version number of this implementation of pari-gp." (interactive) (byte-code "ÀˆÁÂ!‡" [nil gp-meta-command "\\v"] 2))
  208.  
  209. (defun gp-meta-s (num) "\
  210. Sends \\s or \\s(num) to gp, then displays output in the help buffer.
  211.   Prints the state of the pari stack." (interactive "sNumber of longwords (default 0) ") (byte-code "ÁˆÂÃ\"ƒÄÅ!‚ÄÆÇQ!‡" [num nil equal "" gp-meta-command "\\s" "\\s(" ")"] 6))
  212.  
  213. (defun gp-meta-a (num) "\
  214. Sends \\a or \\a<num> to gp, then displays output in the help buffer.
  215.   Prints object %<num> in raw format." (interactive "sPrint object (default last) %%") (byte-code "ÁˆÂÃ\"ƒÄÅ!‚ÄÅP!‡" [num nil equal "" gp-meta-command "\\a"] 5))
  216.  
  217. (defun gp-meta-b (num) "\
  218. Sends \\b or \\b<num> to gp, then displays output in the help buffer.
  219.   Prints object %<num> in pretty format." (interactive "sPrint object (default last) %%") (byte-code "ÁˆÂÃ\"ƒÄÅ!‚ÄÅP!‡" [num nil equal "" gp-meta-command "\\b"] 5))
  220.  
  221. (defun gp-meta-m (num) "\
  222. Sends \\m or \\m<num> to gp, then displays output in the help buffer.
  223.   Prints object %<num> in prettymatrix format." (interactive "sPrint object (default last) %%") (byte-code "ÁˆÂÃ\"ƒÄÅ!‚ÄÅP!‡" [num nil equal "" gp-meta-command "\\m"] 5))
  224.  
  225. (defun gp-meta-k nil "\
  226. Sends \\k to gp.
  227.   Prompts for confirmation before 
  228.   re-initialising gp and clearing the buffer." (interactive) (byte-code "ÁˆÂÃ!…%ÄqˆdbˆÅcˆÆÇ!`\"ˆÂÈ!… É ˆÊÅ\"ˆËÌ!‡" [gp-process nil y-or-n-p "Re-initialise gp ? " "*PARI*" "\\k
  229. " set-marker process-mark "Clear *PARI* buffer ? " erase-buffer process-send-string message ""] 8))
  230.  
  231. (defun gp-meta-q nil "\
  232. Sends \\q to gp.
  233.   Prompts for confirmation before quiting." (interactive) (byte-code "ÁˆÂÃ!…ÄqˆdbˆÅÆ\"ˆÇÈ!‡" [gp-process nil y-or-n-p "Quit gp ? " "*PARI*" process-send-string "\\q
  234. " message ""] 4))
  235.  
  236. (defun gp-break-long-line nil "\
  237. gp will not accept lines longer than 256.
  238.    gp-break-long-line breaks current line 
  239.    inserting \\ every (screen-width)-5 chars." (interactive) (byte-code "ÁˆÂ ÃZÄ^Å!ˆÆÇ!?…ÈcˆÅ!ˆ‚
  240. )‡" [length nil screen-width 5 250 move-to-column looking-at "$" "\\
  241. "] 6))
  242.  
  243. (defun gp-completion-file (file) "\
  244. Takes a file in the format of pari.menu, and adds all the commands
  245.   listed  to the obarray used for completion. If used interactively,
  246.   prompts for the filename in the minibuffer
  247.   The file must have at least one comment line, starting with #, All
  248.   lines before the first comment line are IGNORED." (interactive "fFile of command names: ") (byte-code "ÁˆŠÂ!qˆebˆÃÄ!ˆm?…/ÅÆ!ˆÇÄ!ƒ\"Á‚+ÈÉ`Ê ˆ`\"!ˆ‚)‡" [file nil find-file-noselect re-search-forward "#" forward-line 1 looking-at gp-add-symbol buffer-substring end-of-line] 10))
  249.  
  250. (defun gp-completion-list (&rest args) "\
  251. The arguments are taken as a list of strings, each string is stored
  252.   as a symbol in the obarray used for completion.
  253.   So (gp-completion-list \"foo\" \"bar\" \"baz\") in the gp-mode-hook will
  254.   let the completion functions 'know' these commands." (byte-code "ÁÂ\"‡" [args mapcar gp-add-symbol] 3))
  255.  
  256. (defun gp-add-symbol (name) "\
  257. Add a name to the obarray" (byte-code "Â!ˆÃÄ!    \"‡" [name gp-c-array make-symbol intern downcase] 5))
  258.  
  259. (defun gp-complete nil "\
  260. Attempts to complete a partially typed command in the *PARI*
  261.   buffer. Displays possible completions in the help buffer if no
  262.   unique completion can be done." (interactive) (byte-code "ňhÆU?… ÇÈ!ˆhÆU…ÉÈ!ˆ`ÊËÇÌ!ˆ`\"!Í     \"
  263. Ä=ƒ@ÎÏ!…8ÐÏ!ˆÑÒ    \"‚ˆ
  264. Å=ƒLÑÓ!‚ˆÔ
  265.     \"?…d
  266. cˆÕ    G\\Ö×    G\"\\\"ˆÄÍ
  267. \"=ƒÎÏ!…wÐÏ!ˆÑÒ
  268. \"‚ˆÏØÙ     \"!‘+‡" [c-begin word comp gp-c-array t nil 92 forward-word -1 forward-char downcase buffer-substring 1 try-completion get-buffer "*gp-help*" delete-windows-on message "%s is complete" "No Match found" string= delete-region * 2 display-completion-list all-completions] 22))
  269.  
  270. (gp-completion-list "\\precision" "\\serieslength" "\\format")
  271.  
  272. (defun gp-menu nil "\
  273. Major-mode for the gp menu buffer.
  274. The available commands are
  275. \\{gp-menu-map}" (interactive) (byte-code "ƈÇ!ˆÂ‰ˆÈ ˆÀ‰ˆÉ‰ˆÊ
  276. !ˆË ‡" [gp-menu buffer-read-only t major-mode mode-name gp-menu-map nil find-file-other-window kill-all-local-variables "GP MENU" use-local-map gp-menu-main] 5))
  277.  
  278. (defun gp-menu-info nil (byte-code "ÀÁ!‡" [message "SPC=next DEL=previous RET=select m=main-menu q=quit s=scroll-help"] 2))
  279.  
  280. (defun gp-menu-next nil "\
  281. Move down one line of the gp help menu. (Go to top if at the end.)" (interactive) (byte-code "ÀˆÁ ˆÂÃ!ˆm…Ä ˆeb‡" [nil gp-menu-info forward-line 1 ding] 4))
  282.  
  283. (defun gp-menu-previous nil "\
  284. Move up one line of the gp help menu. (Go to bottom if at the top.)" (interactive) (byte-code "ÀˆÁ ˆoƒ ˆdbˆÃ ‚ÄÅ!‡" [nil gp-menu-info ding beginning-of-line forward-line -1] 5))
  285.  
  286. (defun gp-menu-quit nil "\
  287. Switch the *PARI* buffer if it exists, or (other-buffer) if it does not." (interactive) (byte-code "ÈÄÅ!ÆÅ!ƒÇ ˆÈ!‚%    ƒ!É    !‚%ÉÊ !*‡" [w b t nil get-buffer-window "*PARI*" get-buffer delete-window select-window switch-to-buffer other-buffer] 8))
  288.  
  289. (defun gp-menu-select nil "\
  290. Select a subject from the main menu, or a manual entry from a subject menu." (interactive) (byte-code "Áˆƒ3Á‰ˆÃ ˆÄ ˆÅ`Æ ˆ`\"ÇÈÉ
  291. P!ˆÊË!ˆ`ÈÌ!ˆÍÎ!\")ˆeb‚?Ä ˆÏÅ`Æ ˆ`\"!ˆÐ ‡" [main-menu nil sect widen beginning-of-line buffer-substring end-of-line narrow-to-region re-search-forward "^###" forward-line 1 "
  292. ###" match-beginning 0 gp-get-man-entry gp-menu-info] 15))
  293.  
  294. (defun gp-menu-main nil "\
  295. Display the main menu." (interactive) (byte-code "ÁˆÄ ˆÅ ˆebˆÆ`ÇÈ!ˆÉÊ!\"ˆebˆÁ‰ˆÃ‰‡" [done nil main-menu t gp-menu-info widen narrow-to-region re-search-forward "
  296. ###" match-beginning 0] 7))
  297.  
  298. (defun gp-menu-scroll nil "\
  299. Scroll the gp help window if it is visible" (interactive) (byte-code "ÁˆÂ ˆÃÄ!…$Å ÆÄ!ˆÇd!ƒeb‚È ˆÉ!)‡" [wind nil gp-menu-info get-buffer-window "*gp-help*" selected-window switch-to-buffer-other-window pos-visible-in-window-p scroll-up select-window] 8))
  300.  
  301. (defvar gp-menu-map (make-sparse-keymap) "\
  302. Local keymap used in gp menu buffer.")
  303.  
  304. (define-key gp-menu-map " " (quote gp-menu-next))
  305.  
  306. (define-key gp-menu-map "" (quote gp-menu-previous))
  307.  
  308. (define-key gp-menu-map "
  309. " (quote gp-menu-select))
  310.  
  311. (define-key gp-menu-map "q" (quote gp-menu-quit))
  312.  
  313. (define-key gp-menu-map "m" (quote gp-menu-main))
  314.  
  315. (define-key gp-menu-map "s" (quote gp-menu-scroll))
  316.